<?php


namespace App\Http\Controllers\admin\api;


use App\Http\Controllers\admin\service\AccountCenterService;
use App\Http\Controllers\admin\validate\AccountCenter;
use App\Http\Controllers\utils\ToolUtil;
use App\Http\Controllers\utils\ValidateUtils;
use Illuminate\Http\Request;

class AccountCenterApi
{

    public function getLoginCode(Request $request)
    {
        $param = $request->all();
        $data = AccountCenter::getLoginCode($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::getLoginCode($param);
    }    

    public function codeLogin(Request $request)
    {
        $param = $request->all();
        $data = AccountCenter::codeLogin($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::codeLogin($param);
    }    

    public function register(Request $request){
        $param = $request->all();
        $data = AccountCenter::register($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::register($param);
    }

    public function getCode(Request $request){
        $param = $request->all();
        $data = AccountCenter::getCode($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::smsAli($param);
    }

    public function login(Request $request){
        $param = $request->all();
        $data = AccountCenter::login($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::login($param);
    }

    public function loginOut(Request $request){
        $param = $request->all();
        $data = AccountCenter::loginOut($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::loginOut($param);
    }

    public function queryAdminAll(Request $request){
        $param = $request->all();
        $data = AccountCenter::queryAdminAll($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::queryAdminAll($param);
    }

    public function queryPersonalInfo(Request $request){
        $param = $request->all();
        $data = AccountCenter::queryPersonalInfo($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::queryPersonalInfo($param);
    }

    public function editPersonalInfo(Request $request){
        $param = $request->all();
        $data = AccountCenter::editPersonalInfo($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::editPersonalInfo($param);
    }

    public function disableAdmin(Request $request){
        $param = $request->all();
        $data = AccountCenter::disableAdmin($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::disableAdmin($param);
    }

    public function examineAdmin(Request $request){
        $param = $request->all();
        $data = AccountCenter::examineAdmin($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::examineAdmin($param);
    }

    public function queryAdminLog(Request $request){
        $param = $request->all();
        $data = AccountCenter::queryAdminLog($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::queryAdminLog($param);
    }

    public function queryEmpowerInfo(Request $request){
        $param = $request->all();
        $data = AccountCenter::queryEmpowerInfo($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::queryEmpowerInfo($param);
    }

    public function empowerExamine(Request $request){
        $param = $request->all();
        $data = AccountCenter::empowerExamine($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::empowerExamine($param);
    }

    public function queryTeacherInfo(Request $request){
        $param = $request->all();
        $data = AccountCenter::queryTeacherInfo($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::queryTeacherInfo($param);
    }

    public function queryParentInfo(Request $request){
        $param = $request->all();
        $data = AccountCenter::queryTeacherInfo($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::queryParentInfo($param);
    }

    public function uploadAvatar(Request $request){
        $param = $request->all();
        $data = AccountCenter::uploadAvatar($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::uploadAvatar($param);
    }

    public function queryPushLog(Request $request){
        $param = $request->all();
        $data = AccountCenter::queryPushLog($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::queryPushLog($param);
    }

    public function queryGroup(Request $request){
        $param = $request->all();
        $data = AccountCenter::queryGroup($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::queryGroup($param);
    }

    public function queryIdGroup(Request $request){
        $param = $request->all();
        $data = AccountCenter::queryIdGroup($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::queryIdGroup($param);
    }

    public function editGroup(Request $request){
        $param = $request->all();
        $data = AccountCenter::editGroup($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::editGroup($param);
    }

    public function retrievePassword(Request $request){
        $param = $request->all();
        $data = AccountCenter::retrievePassword($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return AccountCenterService::retrievePassword($param);
    }
}